//
//  OverViewViewController.swift
//  Nola
//
//  Created by loac on 29/05/2025.
//

import UIKit
import DotLottie

class OverViewViewController: UIViewController {
    
    private let dotLottie = DotLottieAnimation(
        fileName: "hello",
        config: AnimationConfig(autoplay: true, loop: true)
    )
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "概览"
        
        
        setupUI()
    }
    
    private func setupUI() {
        let title = UILabel()
        title.text = "欢迎使用 Nola"
        title.font = UIFont.preferredFont(forTextStyle: .largeTitle)
        title.translatesAutoresizingMaskIntoConstraints = false
        
        let tips = UILabel()
        tips.text = "登录账号继续"
        tips.font = UIFont.preferredFont(forTextStyle: .title3)
        tips.translatesAutoresizingMaskIntoConstraints = false
        
        
        let dotLottieView: DotLottieAnimationView = dotLottie.view()
        dotLottieView.translatesAutoresizingMaskIntoConstraints = false
        
        
        view.addSubview(title)
        view.addSubview(tips)
        view.addSubview(dotLottieView)
        
        NSLayoutConstraint.activate([
            title.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor),
            title.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor),
            tips.leadingAnchor.constraint(equalTo: title.leadingAnchor),
            tips.topAnchor.constraint(equalTo: title.bottomAnchor, constant: 10),
            
            dotLottieView.topAnchor.constraint(equalTo: tips.bottomAnchor, constant: 10),
            dotLottieView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            dotLottieView.heightAnchor.constraint(equalToConstant: 300),
            dotLottieView.widthAnchor.constraint(equalToConstant: 300)
        ])
    }
}
